package com.demo.controller;

import com.demo.pojo.Account;
import com.demo.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @ClassName AccountController
 * @Description TODO
 * @Author Windy
 * @Date 2022/9/9 10:22
 * @Version 1.0
 **/
@Controller
@RequestMapping("account")
public class AccountController {
    @Autowired
    private AccountService service;

//    @RequestMapping("findAll")
//    @ResponseBody
//    public List<Account> findAll(){
//        List<Account> all = service.findAll();
//        System.out.println(all);
//        return all;
//    }
@RequestMapping("findAll")
//@ResponseBody
public String findAll(){
    List<Account> all = service.findAll();
    System.out.println(all);
    return "demo01";
}
@RequestMapping("/{page}")
    public String returnPage(@PathVariable("page") String page){
    System.out.println("111111111111111"+page);
        return page;
}
}
